/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mii.ejb.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author TEKNISI
 */
@Entity
public class Customer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String kodeCust;
    private String nameCust;
    private String addCust;
    private String telpCust;
    private String emailCust;
    @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL)
    private List<Complain> complain;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Customer)) {
            return false;
        }
        Customer other = (Customer) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mii.ejb.entity.Customer[ id=" + id + " ]";
    }

    /**
     * @return the kodeCust
     */
    public String getKodeCust() {
        return kodeCust;
    }

    /**
     * @param kodeCust the kodeCust to set
     */
    public void setKodeCust(String kodeCust) {
        this.kodeCust = kodeCust;
    }

    /**
     * @return the nameCust
     */
    public String getNameCust() {
        return nameCust;
    }

    /**
     * @param nameCust the nameCust to set
     */
    public void setNameCust(String nameCust) {
        this.nameCust = nameCust;
    }

    /**
     * @return the addCust
     */
    public String getAddCust() {
        return addCust;
    }

    /**
     * @param addCust the addCust to set
     */
    public void setAddCust(String addCust) {
        this.addCust = addCust;
    }

    /**
     * @return the telpCust
     */
    public String getTelpCust() {
        return telpCust;
    }

    /**
     * @param telpCust the telpCust to set
     */
    public void setTelpCust(String telpCust) {
        this.telpCust = telpCust;
    }

    /**
     * @return the emailCust
     */
    public String getEmailCust() {
        return emailCust;
    }

    /**
     * @param emailCust the emailCust to set
     */
    public void setEmailCust(String emailCust) {
        this.emailCust = emailCust;
    }

    /**
     * @return the complain
     */
    public List<Complain> getComplain() {
        return complain;
    }

    /**
     * @param complain the complain to set
     */
    public void setComplain(List<Complain> complain) {
        this.complain = complain;
    }
    
}
